﻿<UserControl
    x:Class="Adaptive.ReactiveTrader.Client.UI.SpotTiles.SpotTileNotionalControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
    xmlns:core="using:Microsoft.Xaml.Interactions.Core"
    xmlns:designer="using:Adaptive.ReactiveTrader.Client.UI.SpotTiles.Designer"
    mc:Ignorable="d"
    d:DesignHeight="150"
    d:DesignWidth="328"
    d:DataContext="{d:DesignInstance designer:DesignTimeSpotTilePricingViewModel, IsDesignTimeCreatable=True}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Styles/Brushes.xaml" />
                <ResourceDictionary Source="/Styles/TextBox.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Border Background="Transparent">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="NotionalPointerGroup">
                <VisualState x:Name="PointerOverNotional">
                    <Storyboard>
                        <DoubleAnimation Duration="0:0:0.150" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BackgroundBorder" d:IsOptimized="True"/>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.Foreground)" Storyboard.TargetName="DealtCcyTextBlock">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PrimaryForeground}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.Foreground)" Storyboard.TargetName="NotionalTextBox">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PrimaryForeground}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="NotPointerOverNotional">
                    <Storyboard>
                        <DoubleAnimation Duration="0:0:0.150" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="BackgroundBorder" d:IsOptimized="True"/>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <interactivity:Interaction.Behaviors>
            <core:EventTriggerBehavior EventName="PointerEntered">
                <core:GoToStateAction StateName="PointerOverNotional"/>
            </core:EventTriggerBehavior>
            <core:EventTriggerBehavior EventName="PointerExited">
                <core:GoToStateAction StateName="NotPointerOverNotional"/>
            </core:EventTriggerBehavior>
        </interactivity:Interaction.Behaviors>

        <Border x:Name="UnderlineNotionalBorder" HorizontalAlignment="Left" Width="146">
            <Grid>
                <Border x:Name="BackgroundBorder" Background="{StaticResource PriceButtonMouseOverBrush}" Opacity="0" BorderThickness="0,0,0,1" BorderBrush="{StaticResource PrimaryForeground}" />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <TextBlock x:Name="DealtCcyTextBlock" Grid.Column="0" Text="{Binding DealtCurrency}" FontSize="16" Margin="0" Padding="0" Foreground="{StaticResource SecondaryForeground}" />

                    <TextBox x:Name="NotionalTextBox" Grid.Column="1" Text="{Binding Notional, Mode=TwoWay}" 
                            TextAlignment="Left"
                            Margin="5,0,5,1" AcceptsReturn="False"
                            FontSize="16"
							Foreground="{StaticResource SecondaryForeground}"
                            Style="{StaticResource ChromelessTextBoxStyle}" />
                </Grid>
            </Grid>
        </Border>
    </Border>
</UserControl>
